# Maintainer: Jelle van der Waa <jelle@archlinux.org>
# Contributor: kevku <kevku@gmx.com>

pkgname=geckodriver
pkgver=0.33.0
pkgrel=1
pkgdesc="Proxy for using W3C WebDriver-compatible clients to interact with Gecko-based browsers."
arch=("loong64" "x86_64")
url="https://github.com/mozilla/geckodriver"
license=("MPL")
makedepends=("rust" "cargo" "gcc-libs")
source=($pkgname-$pkgver.tar.gz::https://github.com/mozilla/geckodriver/archive/refs/tags/v${pkgver}.tar.gz)
sha256sums=('f796679ae35a4c32b9248da9401f058578e06eec1808f4ce0abb76e2ee64b653')
validpgpkeys=('14F26682D0916CDD81E37B6D61B7B526D98F0353') # Mozilla Software Releases <release@mozilla.com>

build() {
  cd $pkgname-$pkgver
  cargo build --bin geckodriver --release
}

package() {
  cd $pkgname-$pkgver
  install -Dm755 target/release/$pkgname "$pkgdir"/usr/bin/$pkgname
  ln -sf /usr/bin/$pkgname "$pkgdir"/usr/bin/wires
}
